<?php

// JCART v1.2
// http://conceptlogic.com/jcart/


// IF THE USER HASN'T SET A VALUE
if (empty($wp_blog_header))
	{
	// ASSUME WORDPRESS IS INSTALLED IN ROOT
	$wp_blog_header = $_SERVER['DOCUMENT_ROOT'] . '/kreativsounds.com/wp-blog-header.php';
	}
include_once($wp_blog_header);


// PRE-2.6 COMPATIBILITY
if (!defined('WP_CONTENT_URL'))
	{
	define('WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
	}

if (!defined('WP_CONTENT_DIR'))
	{
	define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content');
	}

if (!defined('WP_PLUGIN_URL'))
	{
	define('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
	}

if (!defined('WP_PLUGIN_DIR'))
	{
	define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
	}


// FORM FIELDS
$jcart['item_id'] = get_option('jcart_item_id');
$jcart['item_name'] = get_option('jcart_item_name');
$jcart['item_price'] = get_option('jcart_item_price');
$jcart['item_qty'] = get_option('jcart_item_qty');
$jcart['item_add'] = get_option('jcart_item_add');

// wp-mod: NOT USED SINCE WE HAVE WP CONSTANTS
// PATH TO THE DIRECTORY CONTAINING JCART FILES
// $jcart['path']			= get_option('siteurl') . '/wp-content/plugins/jcart/';

// CHECKOUT PAGE
$jcart['form_action'] = get_option('jcart_form_action');

// PAYPAL SETUP
$jcart['paypal_id'] = get_option('jcart_paypal_id');
$jcart['paypal_currency'] = get_option('jcart_paypal_currency');

// DISPLAY TEXT
$jcart['text']['cart_title'] = get_option('jcart_cart_title');
$jcart['text']['single_item'] = get_option('jcart_single_item');
$jcart['text']['multiple_items'] = get_option('jcart_multiple_items');
$jcart['text']['subtotal'] = get_option('jcart_subtotal');

$jcart['text']['update_button'] = get_option('jcart_update_button');
$jcart['text']['checkout_button'] = get_option('jcart_checkout_button');
$jcart['text']['checkout_paypal_button'] = get_option('jcart_checkout_paypal_button');
$jcart['text']['remove_link'] = get_option('jcart_remove_link');
$jcart['text']['empty_button'] = get_option('jcart_empty_button');
$jcart['text']['empty_message'] = get_option('jcart_empty_message');
$jcart['text']['item_added_message'] = get_option('jcart_item_added_message');

$jcart['text']['price_error'] = get_option('jcart_price_error');
$jcart['text']['qty_error'] = get_option('jcart_qty_error');
$jcart['text']['checkout_error'] = get_option('jcart_checkout_error');

$jcart['button']['update'] = get_option('jcart_update_image');
$jcart['button']['empty'] = get_option('jcart_empty_image');
$jcart['button']['checkout'] = get_option('jcart_checkout_image');
$jcart['button']['checkout_paypal'] = get_option('jcart_checkout_paypal_image');

// DEFAULT CART TEXT USED IF NOT OVERRIDDEN IN jcart-config.php
// DEFAULTS MUST BE AVAILABLE TO jcart.php, AND jcart-javascript.php AND jcart-javascript.min.php
// INCLUDED AS A SEPARATE FILE TO SIMPLIFY USER CONFIG

// wp-mod: ASSUME WORDPRESS IS INSTALLED IN ROOT, USER CAN OVERRIDE IN WP ADMIN IF NOT
// if (!$jcart['path']) die('The path to jCart isn\'t set. Please see <strong>jcart-config.php</strong> for more info.');

if (!$jcart['text']['cart_title']) $jcart['text']['cart_title']							= 'Shopping Cart';
if (!$jcart['text']['single_item']) $jcart['text']['single_item']						= 'Item';
if (!$jcart['text']['multiple_items']) $jcart['text']['multiple_items']					= 'Items';
if (!$jcart['text']['subtotal']) $jcart['text']['subtotal']								= 'Subtotal';

if (!$jcart['text']['update_button']) $jcart['text']['update_button']					= 'update';
if (!$jcart['text']['checkout_button']) $jcart['text']['checkout_button']				= 'checkout';
if (!$jcart['text']['checkout_paypal_button']) $jcart['text']['checkout_paypal_button']	= 'Checkout with PayPal';
if (!$jcart['text']['remove_link']) $jcart['text']['remove_link']						= 'remove';
if (!$jcart['text']['empty_button']) $jcart['text']['empty_button']						= 'empty';
if (!$jcart['text']['empty_message']) $jcart['text']['empty_message']					= 'Your cart is empty!';
if (!$jcart['text']['item_added_message']) $jcart['text']['item_added_message']			= 'Item added!';

if (!$jcart['text']['price_error']) $jcart['text']['price_error']						= 'Invalid price format!';
if (!$jcart['text']['quantity_error']) $jcart['text']['quantity_error']					= 'Item quantities must be whole numbers!';
if (!$jcart['text']['checkout_error']) $jcart['text']['checkout_error']					= 'Your order could not be processed!';

?>
